-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse working_dir switch #195
Conversation
- parse output path and component to run as switch -o and --component
lib/cli.ex
Outdated
|
||
parsed_switches | ||
|> Keyword.get(:working_dir, File.cwd!()) | ||
|> module.main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Elixir style guide suggests using parentheses in the pipe operator.
Use parentheses for one-arity functions when using the pipe operator (
|>
).
|> module.main | |
|> module.main() |
I’d generally incline towards using them for functions without an argument, mainly for consistency. The Guide considers that preferred, although in other examples they use them without parens a lot themselves.
Use parentheses in function calls, especially inside a pipeline.
--working-dir is switch which allow user use different working directory than only current working directory
81546fb
to
8f80dca
Compare
8f80dca
to
4e5fa37
Compare
- working_dir is more precise naming for the intend purpose, - working_dir is also name of the switch we use on CLI
DONT FORGET TO TESTS!! |
Test lowercase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works like a charm! ❤️ Now it’s time to write tests. 💪🏻
Reade for review I've already merged #223 to this PR! |
95303f2
to
47e06ed
Compare
Just discovered a Mix.Shell module that has a cmd function with a Update: I took a look and Mix.Shell.cmd/3 can be used to make Mix run a shell command. |
Co-authored-by: Glutexo <driezasson@me.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Thank you for the changes! ❤️
fix #182